package main

import (
	"gitee.com/goxiang2/server/benchmark/rpc/proto"
	"gitee.com/goxiang2/server/lib/lib_rpc"
	"log"
	"net"
)

type User struct{}

func (t *User) Add(args *proto.AddReq, reply *proto.AddRsp) (uint32, error) {
	reply.C = args.A + args.B
	return 123, nil
}

func main() {
	s := lib_rpc.NewServer()

	s.RegisterName("AddServer", &User{})

	l, err := net.Listen("tcp", ":12323")
	if err != nil {
		log.Fatal("listen error:", err)
	}
	s.Accept(l)

}
